package taskshare.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import org.slim3.datastore.Datastore;
import org.slim3.datastore.EntityNotFoundRuntimeException;

import taskshare.model.Comment;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class CommentService {

    UserService userService = UserServiceFactory.getUserService();

    public List<Comment> getList(Set<Key> keys) {
        List<Comment> commentList = new ArrayList<Comment>();
        for (Key key : keys) {
            try {
                Comment comment = Datastore.get(Comment.class, key);
                commentList.add(comment);
            } catch (EntityNotFoundRuntimeException e) {
                // NOP
            }
        }

        return commentList;
    }

}
